"""
@author: xxw
@file: 计算相差天数.py
@time: 2023/4/20 11:25
"""
from datetime import datetime

# 定义两个时间点
time1 = input("请输入年、月、日(用-分割)")
time2 = input("请输入年、月、日(用-分割)")
time1 = time1.split("-")
time2 = time2.split("-")
for i in range(0, len(time1)):
    time1[i] = int(time1[i])
for i in range(0, len(time2)):
    time2[i] = int(time2[i])

time_a = datetime(time1[0], time1[1], time1[2])
time_b = datetime(time2[0], time2[1], time2[2])

# 计算时间差
delta = time_a - time_b

# 提取差值中的天数部分
days_diff = delta.days

print("时间1：", time1)
print("时间2：", time2)
if days_diff < 0:
    days_diff = -days_diff
print("时间相差的天数：", days_diff)